<template>
    <button @click="handleAdd">点击{{ value }}</button>
</template>
<script type="module">
import * as $http from "../scripts/fetch.js";
export default {
    data() {
        return {
            value: 0
        }
    },
    methods: {
        handleAdd() {
            let data = { id: 0 };
            $http.post("/app/mock/getToken", data).then((res) => {
              console.log("res:", res);
            }).catch((err)=>{
              console.log(err)
            })
            this.value++
        }
    }
}
</script>